package com.it.cloud.consumer.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import com.it.cloud.consumer.entity.User;

@RestController
public class UserController {
	@Autowired
	private RestTemplate restTemplate;
	@GetMapping("/slag/{id}")
	public User getUser(@PathVariable Long id){
		System.out.println("22222222222222");
		return this.restTemplate.getForObject("http://localhost:7900/simple/"+id, User.class);
	}
	

}
